﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using DAL.Repositories;

namespace BLL
{
    public class ScreenCastCTR : Interfaces.IScreenCastCTR
    {
        ScreenCastRepository _screenCastRep;

        public ScreenCastCTR()
        {
            _screenCastRep = new ScreenCastRepository();
        }

        /// <summary>
        /// Get all screen casts for movie
        /// </summary>
        /// <param name="movie">Movie to find screen casts for</param>
        /// <param name="cinema">Cinema to get screen casts from</param>
        /// <returns>Screen casts for movie</returns>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="Exception"></exception>
        public IList<ScreenCast> GetScreenCasts(Movie movie, Cinema cinema)
        {
            return _screenCastRep.GetScreenCasts(movie, cinema);
        }

        /// <summary>
        /// Add screenCast to DB
        /// </summary>
        /// <param name="screenCast">screenCast</param>
        /// <exception cref="ArgumentException">If provided screen cast object is null</exception>
        /// <exception cref="Exception"></exception>
        public void AddScreenCast(ScreenCast screenCast)
        {
            _screenCastRep.AddScreenCast(screenCast);
        }

        /// <summary>
        /// Get a screen cast from its id
        /// </summary>
        /// <param name="id">Id of screen cast</param>
        /// <returns>Screen cast with Id</returns>
        /// <exception cref="Exception"></exception>
        public ScreenCast GetScreenCast(int id)
        {
            return _screenCastRep.GetScreenCast(id);
        }
    }
}
